﻿<%@ Page Title="" Language="C#" Theme="Default_Themes" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="QuanLyDanhMuc.aspx.cs" Inherits="DanhMuc_QuanLyDanhMuc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="row-fluid">
        <div class="span12">
            <div class="box">
                <div class="box-title">
                    <h3><i class="icon-file"></i>Quản lý các danh mục</h3>
                    <div class="box-tool">
                        <a data-action="collapse" href="#"><i class="icon-chevron-up"></i></a>
                        <a data-action="close" href="#"><i class="icon-remove"></i></a>
                    </div>
                </div>
                <div class="box-content" style="border:1px solid #B6D1F2;" >
                    <asp:UpdatePanel ID="udt1" runat="server">
                        <ContentTemplate>
                            <div class="control-group info">
                                <label class="control-label" style="width:250px;padding-right:10px;">Chọn loại danh mục</label>
                                <div class="controls">
                                    <asp:DropDownList ID="drlLoai" runat="server" CssClass="span4" Height="25px" AutoPostBack="true" OnSelectedIndexChanged="drlLoai_SelectedIndexChanged"></asp:DropDownList>
                                </div>
                                <div style="height:5px;"></div>
                                <label class="control-label" style="width:250px;padding-right:10px;">Nhập tên danh mục</label>
                                <div class="controls">
                                    <asp:TextBox ID="txtTenDanhMuc" runat="server" CssClass="span4" onblur="KiemTraInjection(this);"></asp:TextBox>
                                     <asp:LinkButton ID="btnadd" OnClick="btnadd_Click1" class="btn btn-primary"  runat="server" Width="70px"><i class="icon-save"></i>&nbsp;&nbsp;Lưu</asp:LinkButton>
                                    <span class="help-inline"><asp:Label ID="lblmessage" runat="server" Text=""></asp:Label></span>
                                </div>
                                <div style="height:15px;"></div>
                                <asp:GridView ID="grid" runat="server" W AutoGenerateColumns="False" DataKeyNames="ID" OnRowCancelingEdit="grid_RowCancelingEdit" OnRowDeleting="grid_RowDeleting" OnRowEditing="grid_RowEditing" OnRowUpdating="grid_RowUpdating" CellPadding="4" ForeColor="#333333" GridLines="None">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Tên danh mục" SortExpression="TenDanhMuc">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="txtTenDanhMuc" CssClass="textboxformat" runat="server" Text='<%# Bind("TenDanhMuc") %>' onblur="KiemTraInjection(this);"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("TenDanhMuc") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Sửa danh mục">
                                            <EditItemTemplate>
                                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="Lưu"></asp:LinkButton>
                                                &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="Hủy"></asp:LinkButton>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="Sửa"></asp:LinkButton>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Xóa danh mục">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="LinkButtonxoa" runat="server" CausesValidation="false" 
                                                    CommandName="Delete" Text="Xóa" OnClientClick="return confirm('Bạn có chắc xóa không? Nếu xóa thì tất cả thông tin liên quan (cơ sở đoàn, đoàn viên sẽ bị xóa theo!)')"></asp:LinkButton>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                </asp:GridView>
                            </div>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnadd" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
            </div>
        </div>
    </div>
    <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
</asp:Content>

